package com.googlecode.quillen.service;

import com.googlecode.quillen.domain.ShadowFile;
import com.googlecode.quillen.domain.ObjectStorageException;
import com.googlecode.quillen.domain.AttributeStorageException;
import com.googlecode.quillen.util.ResultConsumer;

import java.io.IOException;
import java.io.InputStream;
import java.security.NoSuchAlgorithmException;
import java.util.Collection;
import java.text.ParseException;

/**
 * Created by IntelliJ IDEA.
 * User: greg
 * Date: Dec 6, 2008
 * Time: 3:25:49 PM
 */
public interface ShadowFileService
{
    void createStorage() throws AttributeStorageException, ObjectStorageException;

    void deleteStorage() throws ObjectStorageException, AttributeStorageException;

    ShadowFile get(String shadowKey) throws ObjectStorageException, IOException;

    ShadowFile getStub(String shadowKey) throws AttributeStorageException;

    void put(ShadowFile shadowFile, Collection<String> snapshots) throws ObjectStorageException, IOException, AttributeStorageException;

    void batchPut(Collection<ShadowFile> shadowFiles, Collection<String> snapshots) throws ObjectStorageException, AttributeStorageException, IOException;

    ShadowFile delete(String shadowKey, Collection<String> snapshots) throws ObjectStorageException, AttributeStorageException, IOException;

    String createShadowKey(InputStream in) throws NoSuchAlgorithmException, IOException;

    void findStubs(String snapshot, String filenamePrefix, ResultConsumer<ShadowFile> consumer) throws AttributeStorageException, ParseException;
}
